Passed
Push — master ( d8aded...9944a2 )
by Felipe Catão do
01:14
created

routes.teste   A

Complexity

Conditions 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
1
import EngineApp from '../../Framework/engine.js'
2
import homePage from "../pages/home.js"
3
import docs from '../pages/docs.js'
4
import AboutPage from '../pages/about.js'
5
6
var isCreate=false
7
var eng=new EngineApp()
8
9
class routes{
10
    routesCreated(){
11
        
12
        //sistemas De rotas
13
        if(isCreate==false){
0 ignored issues
show
Best Practice introduced by
Comparing isCreate to false using the == operator is not safe. Consider using === instead.
Loading history...
14
            eng.routesEngine.registerRoute("http://127.0.0.1:5500/LavineWiki/index.html#pageInitial",this.teste)
15
            eng.routesEngine.registerRoute("http://127.0.0.1:5500/LavineWiki/index.html#docs",this.docc) 
16
            eng.routesEngine.registerRoute("http://127.0.0.1:5500/LavineWiki/index.html#about",this.aboutRoute)  
17
        }
18
        isCreate=true
19
        eng.routesEngine.runRoute("http://127.0.0.1:5500/LavineWiki/index.html","http://127.0.0.1:5500/LavineWiki/index.html#pageInitial")
20
        eng.routesEngine.whenUpdate(eng.routesEngine.runRoute("http://127.0.0.1:5500/LavineWiki/index.html","http://127.0.0.1:5500/LavineWiki/index.html#pageInitial"))
21
    
22
    }
23
    teste(){
24
        eng.renderEngine.pageDynamic="dinamic-Article"
25
        eng.renderEngine.clearPage()
26
        homePage()
27
    }
28
    docc(){
29
    eng.renderEngine.pageDynamic="dinamic-Article"
30
    eng.renderEngine.clearPage()
31
    docs()
32
    }
33
    aboutRoute(){
34
        eng.renderEngine.pageDynamic="dinamic-Article"
35
        eng.renderEngine.clearPage()
36
        AboutPage()
37
    }
38
    doc(){
39
        eng.routesEngine.goToLink("http://127.0.0.1:5500/LavineWiki/index.html#docs")
40
    }
41
    about(){
42
        eng.routesEngine.goToLink("http://127.0.0.1:5500/LavineWiki/index.html#about")
43
    }
44
}
45
46
47
export default routes
48